const paths = require('path');
const fs = require('fs');
// 根据命令自动加载相关文件
module.exports = (program, path ) => {
    if (fs.statSync(path).isDirectory()) {
        fs.readdirSync(path).forEach(filename => {
            const filepath = paths.join(path, filename);
            const _f = require(filepath);
            _f(program);
            // if (filename.includes(process.argv[2])) {
            //     const _f = require(filepath);
            //     _f(program);
            // }
        });
    }
    return program
}
